Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Home/Feed #655

Merged
merged 27 commits into from
Jan 5, 2022
Merged

Home/Feed #655

merged 27 commits into from
Jan 5, 2022

Conversation

intergalacticspacehighway
Copy link
Collaborator

@intergalacticspacehighway intergalacticspacehighway commented Jan 5, 2022

Why

How

  • Added Tabs.
  • Infinite query is a custom one. I am facing issues with swr which leads to layout shifts on pull to refresh. I'll be experimenting with it. Thought to make a PR for early feedback as it was taking longer and the custom hook interface will remain the same, so won't affect when we switch to swr.

Test Plan

  • Run the expo app on iOS and Android.
  • Try changing tabs/scroll to bottom and pull to refresh.

@vercel
Copy link

vercel bot commented Jan 5, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/showtime/showtime/7xYTw5Nh1xSogtr21YNrTtmXnqKu
✅ Preview: https://showtime-git-feed-showtime.vercel.app

const footerHeight = 0;
const listRef = useRef(null);

useScrollToTop(listRef);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hook from react navigation enables scroll to top on bottom tab press


return {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to remove the getItemLayout as component heights cannot be determined by images since we have activity and social cards which can be dynamic (let me know if it's possible though). Haven't seen any major performance issue by removing this. We're memoizing cards in FlatList.

// import useSWRInfinite from "swr/infinite";
// import { useInfiniteListQuery } from "./use-infinite-list-query";

// export const useActivity = ({
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept this commented for now. It's swr implementation of the hook. I'll be working on it. This works but leads to layout shift on pull to refresh

@@ -0,0 +1,55 @@
import { useState, useRef } from "react";

export const useInfiniteListQuery = (fetcher) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool hook but will be replaced by swr implementation once I figure out the issue.


const HomeScreen = () => {
const { user } = useUser();
const userId = user?.data?.profile?.profile_id;
const { data, size, setSize, mutate } = useSWRInfinite(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved API hooks closer to the component.

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

PR Preview - Storybook

This pull request preview deployment is now available.

✅ Preview: io.showtime.storybook://expo-development-client/?url=https://exp.host/@tryshowtime/showtime-storybook-react-native/index.exp?release-channel=pr-655&sdkVersion=44.0.0

Comment ID: 1005436158

onRefresh={refresh}
onEndReached={fetchMore}
ref={listRef}
onEndReachedThreshold={0.6}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 0.6 setting works well! Let me know if this needs to be changed

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

PR Preview - Storybook on Chromatic

✅ Preview: The Storybook preview URL for this Pull Request

✅ Build: The Chromatic build URL for this Pull Request

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

PR Preview - App

This pull request preview deployment is now available.

✅ Preview: io.showtime.development://expo-development-client/?url=https://exp.host/@tryshowtime/showtime/index.exp?release-channel=pr-655&sdkVersion=44.0.0

Comment ID:

Copy link
Contributor

@axeldelafosse axeldelafosse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✨ Love to see how we improve the design system as we work on screens.

@@ -13,7 +13,8 @@ import type { TW } from "design-system/tailwind/types";
function Img({ source, width, height, ...props }: ReactNativeImageProps) {
return (
<ReactNativeImage
source={source}
// @ts-ignore
source={source.uri ? { uri: source.uri, cache: "force-cache" } : source}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@axeldelafosse
Copy link
Contributor

Def not a blocker but I just found that the "pinch to dezoom" (the reverse action) is acting weird haha. Also I know this is expected but it's weird that when swiping between tabs it displays the "Home" header again (if it was hidden) -- it's creating a layout shift.

@intergalacticspacehighway intergalacticspacehighway merged commit 0cab622 into staging Jan 5, 2022
@intergalacticspacehighway
Copy link
Collaborator Author

Def not a blocker but I just found that the "pinch to dezoom" (the reverse action) is acting weird haha. Also I know this is expected but it's weird that when swiping between tabs it displays the "Home" header again (if it was hidden) -- it's creating a layout shift.

good catch! will fix it in next PR

TatisLois added a commit that referenced this pull request Jan 17, 2022
* upgrade mmkv

* Home/Feed (#655)

* feed tabs

* pinch to zoom

* pinch to zoom

* pinch to zoom

* pinch to zoom

* fix: feed ptr

* fix: feed images

* fix: feed images

* wip: feed

* wip: feed

* wip: feed

* wip - feed

* wip - feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* wip: feed

* upgrade mmkv

* use correct app scheme and icon for walletconnect

* improve walletconnect implementation

* automatically submit when wallet is connected

* Adjust gas price by a percentage (#653)

* create video component

* Feature/show2 290 trending screen (#663)

* wip: trending

* wip: trending

* wip: trending

* wip: trending

* make api fast again

* optimise creator previre

* optimise creator preview

* optimise creator preview

* optimise creator preview

* Update to handle long collection names (#662)

* Enable Magic on minting & marketplace (#665)

* install three.js + upgrade to react 18 + patch packages

* add model component

* Misc fixes (#666)

* spinner fix

* spinner fix

* add swr

* add swr

* add swr

* initial scroll fix

* add accessToken hook (#667)

* fix: added `useAccessToken` to access token for web (#669)

* feat(SHOW2-225): refactor modal component (#652)

* refactor: updated the modal styling for web

* fix: fixed tailwind colors import

* refactor: updated the modal styling for mobile

* chore: reset modal storybook visibility

* refactor: removed index.web

* fix: fixed the modal body styling on mobile

* refactor: updated modal styling for web/ios

* fix: modal gestures components on Android

Co-authored-by: Axel Delafosse <[email protected]>

* list improvements (#671)

* list improvements

* list improvements

* list improvements

* list improvements

* list improvements

* list improvements

* list improvements

* render model as image for now

* mark svg as todo

* mark blurhash as todo on android

* update logo

* add nft title and description components

* clean code

* Update styles and semantics for listed for per feedback (#660)

* disable save changes button when username is not available (#674)

* use suspense + add types + add navigation elements context and hook to hide

* improve collection component

* add send icon

* add comments + message box

* use constants for scroll and padding height

* clean code

* chore(magic): add magic flag in useFlags and import them into modals (#675)

* Profile screen (#677)

* add flipper

* add flipper

* inti

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* enable double tap

* list improvements

* list improvements

* wip profile

* wip profile

* profile api

* profile wip

* profile wip

* profile wip

* profile wip

* profile wip

* profile wip

* profile wip

* wip profile

* wip profile

* wip profile

* wip profile

* wip profile

* wip profile

* profile change route param

* add react navigation to storybook RN

* add react navigation to storybook RN

* add react navigation to storybook RN

* add react navigation to storybook RN

* add camera

* add reanimated handler to pager (#678)

* add reanimated handler to pager

* add reanimated handler to pager

* new tabs

* Revert "new tabs"

This reverts commit b88ae0b.

* upgrade vision-camera

* add create modal

* clean code

* refactor: updated tabs item header width to be dynamic (#681)

* update dependencies

* upgrade deps and revert yarn.lock changes

* use text-13 for tab items

* render svg via xml + disabled press on media if in nft modal

* fix camera tab bar icon container size

* set trending tabs to full width screen

* use suspense for profile tabs

* clean header dropdown

* Show an error when username is too short

* set user color scheme

* update status bar

* fix imports

* Feature/show2 309 create (#688)

* fieldset

* wip create UI

* wip create UI

* wip create UI

* wip create UI

* remove animated view from header (#692)

* use media component everywhere

* use the modal component for the create screen

* fix: color mode re-renders

* fix: color mode re-renders

* fix: color mode re-renders

* feat(SHOW2-283): added login with SMS flow and refactor login styling (#672)

* fix: updated the button height based on design system

* refactor: updated login screen styling

* feat: added keyboard handling for iOS & Android

* refactor: extracted email field ui into a separate component

* feat: added phone number field

* refactor: added contact details and remove email and phone number components

* feat: added loading view

* chore: removed debug console logs

* fix: set loading state on phone number submitting

* refactor: extract root magic instance

* refactor: updated tabs header item indicator positioning

* refactor: added a generic input field

* refactor: extracted login container and header

* refactor: updated login design to follow design system

* fix: prevent tab header from setting invalid height

* refactor: added text content type to input field

* fix: logout customer when app fails to login

* fix(unlist): allow an item to be unlisted by the owner when it not the lowest item for sale (#683)

* Resolve an issue with next.js caching user profiles to a 404 (#680) (#698)

Co-authored-by: Axel Delafosse <[email protected]>

* rework explore page for marketplace (#700)

* rework explore page for marketplace

* fix mobile links

* fix feed button tracking events

Co-authored-by: Axel Delafosse <[email protected]>
Co-authored-by: Nishan <[email protected]>
Co-authored-by: Axel Delafosse <[email protected]>
Co-authored-by: Miguel Piedrafita <[email protected]>
Co-authored-by: Mo Gorhom <[email protected]>
Co-authored-by: Henry Fontanier <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants